<template>
  <div class="detail">
    <!-- 轮播 -->
    <div class="banner"></div>
    <!-- 硬件产品 -->
    <div class="bg">
      <!-- 动画 -->
      <div class="center">
        <ul class="clearfix">
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
          <li><img src="/img/hardware/DJ_m.jpg" alt="" /></li>
        </ul>
      </div>
      <!-- 硬件商品详情 -->
      <div class="between">
        <div class="boxDetail">
          <h3>{{detail.hname}}</h3>
          <!--小轮播 -->
          <div class="smallBanner">
            <el-carousel :interval="5000" arrow="always">
              <el-carousel-item v-for="item in 4" :key="item">
                <img :src="detail.himg" alt="" style="height:315px;width:750px;display:block;margin:0 auto">
              </el-carousel-item>
            </el-carousel>
          </div>
          <!-- 加盟合作 -->
          <div class="cooperation">
             <button>合作加盟</button>
          </div>
          <!-- 列表 -->
          <table cellspacing="0">
            <tr>
              <td>
                <div>产品介绍</div>
                <p>Product Introduction</p>  
              </td>
              <td>
                <p>{{detail.h_introduct}}</p>
              </td>
            </tr>
            <tr>
              <td>
                <div>产品材质</div>
                <p>Product Material</p>
              </td>
              <td><p>{{detail.h_material}}</p></td>
            </tr>
            <tr>
              <td>
                <div>产品尺寸</div>
                <p>ProSizeduct Size</p>
              </td>
              <td><p>{{detail.h_size}}</p></td>
            </tr>
            <tr>
              <td>
                <div>适用场景</div>
                <p>Applicable Scenarios</p>
              </td>
              <td><p>{{detail.h_scenarios}}</p></td>
            </tr>
            <tr>
              <td>
                <div>使用年限</div>
                <p>Service Life</p>
              </td>
              <td><p>{{detail.h_service}}</p></td>
            </tr>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data(){
    return{
      detail:{}
    }
  },
  methods:{
    detailAxios(){
      let id=this.$route.params.hid;
      this.axios.get('v1/products/hard/hid',{params:{hid:id}}).then((res)=>{
        console.log(res.data.data[0]);
        this.detail=res.data.data[0];
      })
    }
  },
  mounted(){
    this.detailAxios();
  }
}
</script>
<style lang="scss">
@keyframes move {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-800px);
  }
}
.detail {
  // 轮播
  .banner {
    width: 100%;
    height: 400px;
    background-image: url(/img/hardware/banner_hardware.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }
  //   硬件产品
  .bg {
    width: 100%;
    background-color: #f9f9f9;
    .center {
      //动画
      //   background-color: aqua;
      margin: 0 auto;
      width: 1200px;
      padding-top: 20px;
      overflow: hidden;

      ul:hover {
        animation-play-state: paused;
      }
      ul {
        width: 2400px;
        height: 130px;
        animation: 15s move linear infinite;
        list-style: none;

        li {
          border: 1px solid #efefef;
          width: 150px;
          height: 95px;
          line-height: 95px;
          margin-right: 20px;
          float: left;
          img {
            display: block;
            width: 150px;
            height: 90px;
            margin: 0 auto;
          }
        }
      }
    }
    //硬件商品详情
    .between {
      width: 1200px;
      margin: 0 auto;
      background-color: #fff;
      // padding:40px 50px;
      // background-color: blue;
      .boxDetail {
        width: 1100px;
        height: 1463px;
        // background-color: burlywood;
        padding-top: 40px;
        margin: 0 auto;
        h3 {
          font-size: 24px;
          font-weight: 700;
          height: 24px;
          line-height: 24px;
          color: #000;
          margin-bottom: 34px;
        }
        // 合作加盟
        .cooperation{
          overflow: hidden;
          button{
            width: 100px;
            height: 42px;
            background-color: #ffc802;
            border:none;
            color: #fff;
            font-size: 16px;
            border-radius: 5px;
            float: right;
          }
        }
        // 列表
        table{
           margin-top: 65px;
          tr{
            td:nth-child(1){
              width: 232px;
              height: 129px;
              padding: 20px 30px;
              >div{
               font-size: 20px;
               line-height: 28px;
               margin-bottom: 3px;
              }
              p{
                font-size: 15px;
                line-height: 20px;
              }
            }
            td:nth-child(2){
              width: 866px;
              height: 129px;
              padding:20px 30px;
              p{
                font-size: 15px;
                line-height: 23px;
              }
            }
            td{
              border:2px solid #ffc802;
            }
          }
        }
      }
    }
  }
}
</style>